<template>
	<selector v-model="productLineCode" :data="products" fields="code,name"
	          :enumCount="2" @change="productLine_change"
	          chk="*"></selector>
</template>

<script type="text/ecmascript-6" setup>
import productLine from "./product-line.vue";




defineOptions({
    name: "product-line-ref",
    inheritAttrs: true,
});

//定义 vue2的this,当前组件
const $self = getCurrentInstance();

//定义 $attrs
const $attrs = useAttrs();



//定义data
const $data = reactive({"productLineCode":"","products":[]});


const $props = defineProps({

});





const list = ref();

//定义事件
const $emit = defineEmits(["update:modelValue","loaded"]);



const productLine_change = function(v, m) {
    jv.$saveData("productLineCode", $data.productLineCode )
    $emit("update:modelValue", v);
    $emit("change", v, m);
};

onMounted( function() {
    jv.$loadData("productLineCode", v=> $data.productLineCode = v)
// this.db_products = [];
// jv.$http.post("/dev/product-line/list").then(res => {
//   this.db_products = res.data.data;
//
//
//   this.sortWithLastProjectCodes($data.productLineCode)
// })
} )



</script>